﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.Biz
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("fnd_design_lu", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class fnd_design_lu : Entity<fnd_design_lu>,Ifnd_design_lu
    {
        #region 属性
 
        private String _lu_name;

        /// <summary>FLAGS=KMIU-^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>
        [DisplayName("Name")]
        [Description("FLAGS=KMIU-^DATATYPE=STRING(35)^PROMPT=Lu Name^")]
        [DataObjectField(false, false, false, 35)]
        [BindColumn(1, "lu_name",  null, "varchar(35)", 0, 0, false)]

        public virtual String lu_name

        {
            get { return _lu_name; }
            set { if (OnPropertyChanging(__.lu_name, value)) { _lu_name = value; OnPropertyChanged(__.lu_name); } }
        }

 
        private String _description;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(100)^PROMPT=Description^</summary>
        [DisplayName("Description")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(100)^PROMPT=Description^")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn(2, "description",  null, "varchar(100)", 0, 0, false)]

        public virtual String description

        {
            get { return _description; }
            set { if (OnPropertyChanging(__.description, value)) { _description = value; OnPropertyChanged(__.description); } }
        }

 
        private String _module;

        /// <summary>FLAGS=AMI-L^DATATYPE=STRING(10)^PROMPT=Module^</summary>
        [DisplayName("Module")]
        [Description("FLAGS=AMI-L^DATATYPE=STRING(10)^PROMPT=Module^")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(3, "module",  null, "varchar(10)", 0, 0, false)]

        public virtual String module

        {
            get { return _module; }
            set { if (OnPropertyChanging(__.module, value)) { _module = value; OnPropertyChanged(__.module); } }
        }

 
        private String _table_name;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=Table Name^</summary>
        [DisplayName("Name1")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=Table Name^")]
        [DataObjectField(false, false, true, 40)]
        [BindColumn(4, "table_name",  null, "varchar(40)", 0, 0, false)]

        public virtual String table_name

        {
            get { return _table_name; }
            set { if (OnPropertyChanging(__.table_name, value)) { _table_name = value; OnPropertyChanged(__.table_name); } }
        }

 
        private String _view_name;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=View Name^</summary>
        [DisplayName("Name2")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=View Name^")]
        [DataObjectField(false, false, true, 40)]
        [BindColumn(5, "view_name",  null, "varchar(40)", 0, 0, false)]

        public virtual String view_name

        {
            get { return _view_name; }
            set { if (OnPropertyChanging(__.view_name, value)) { _view_name = value; OnPropertyChanged(__.view_name); } }
        }

 
        private String _package_name;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Package Name^</summary>
        [DisplayName("Name3")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Package Name^")]
        [DataObjectField(false, false, true, 35)]
        [BindColumn(6, "package_name",  null, "varchar(35)", 0, 0, false)]

        public virtual String package_name

        {
            get { return _package_name; }
            set { if (OnPropertyChanging(__.package_name, value)) { _package_name = value; OnPropertyChanged(__.package_name); } }
        }

 
        private Byte[] _storage_text;

        /// <summary></summary>
        [DisplayName("Text")]
        [Description("")]
        [DataObjectField(false, false, true, 65535)]
        [BindColumn(7, "storage_text",  null, "blob", 0, 0, false)]

        public virtual Byte[] storage_text

        {
            get { return _storage_text; }
            set { if (OnPropertyChanging(__.storage_text, value)) { _storage_text = value; OnPropertyChanged(__.storage_text); } }
        }

 
        private Byte[] _logical_text;

        /// <summary></summary>
        [DisplayName("Text1")]
        [Description("")]
        [DataObjectField(false, false, true, 65535)]
        [BindColumn(8, "logical_text",  null, "blob", 0, 0, false)]

        public virtual Byte[] logical_text

        {
            get { return _logical_text; }
            set { if (OnPropertyChanging(__.logical_text, value)) { _logical_text = value; OnPropertyChanged(__.logical_text); } }
        }

 
        private Byte[] _data_entity;

        /// <summary></summary>
        [DisplayName("Entity")]
        [Description("")]
        [DataObjectField(false, false, true, 65535)]
        [BindColumn(9, "data_entity",  null, "blob", 0, 0, false)]

        public virtual Byte[] data_entity

        {
            get { return _data_entity; }
            set { if (OnPropertyChanging(__.data_entity, value)) { _data_entity = value; OnPropertyChanged(__.data_entity); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(10, "objid",  null, "varchar(50)", 0, 0, false)]

        public virtual String objid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }

 
        private String _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(11, "objversion",  null, "varchar(24)", 0, 0, false)]

        public virtual String objversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.lu_name : return _lu_name;
                    case __.description : return _description;
                    case __.module : return _module;
                    case __.table_name : return _table_name;
                    case __.view_name : return _view_name;
                    case __.package_name : return _package_name;
                    case __.storage_text : return _storage_text;
                    case __.logical_text : return _logical_text;
                    case __.data_entity : return _data_entity;
                    case __.objid : return _objid;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.lu_name : 
                        if(value != null)
                            _lu_name = Convert.ToString(value);
                        else
                            _lu_name = null;
                    break;
                    case __.description : 
                        if(value != null)
                            _description = Convert.ToString(value);
                        else
                            _description = null;
                    break;
                    case __.module : 
                        if(value != null)
                            _module = Convert.ToString(value);
                        else
                            _module = null;
                    break;
                    case __.table_name : 
                        if(value != null)
                            _table_name = Convert.ToString(value);
                        else
                            _table_name = null;
                    break;
                    case __.view_name : 
                        if(value != null)
                            _view_name = Convert.ToString(value);
                        else
                            _view_name = null;
                    break;
                    case __.package_name : 
                        if(value != null)
                            _package_name = Convert.ToString(value);
                        else
                            _package_name = null;
                    break;
                    case __.storage_text : _storage_text = (Byte[])value; break;
                    case __.logical_text : _logical_text = (Byte[])value; break;
                    case __.data_entity : _data_entity = (Byte[])value; break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToString(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMIU-^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>
            public static readonly Field lu_name = FindByName(__.lu_name);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(100)^PROMPT=Description^</summary>
            public static readonly Field description = FindByName(__.description);

            ///<summary>FLAGS=AMI-L^DATATYPE=STRING(10)^PROMPT=Module^</summary>
            public static readonly Field module = FindByName(__.module);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=Table Name^</summary>
            public static readonly Field table_name = FindByName(__.table_name);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=View Name^</summary>
            public static readonly Field view_name = FindByName(__.view_name);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Package Name^</summary>
            public static readonly Field package_name = FindByName(__.package_name);

            ///<summary></summary>
            public static readonly Field storage_text = FindByName(__.storage_text);

            ///<summary></summary>
            public static readonly Field logical_text = FindByName(__.logical_text);

            ///<summary></summary>
            public static readonly Field data_entity = FindByName(__.data_entity);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMIU-^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>
            public const String lu_name = "lu_name";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(100)^PROMPT=Description^</summary>
            public const String description = "description";

            ///<summary>FLAGS=AMI-L^DATATYPE=STRING(10)^PROMPT=Module^</summary>
            public const String module = "module";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=Table Name^</summary>
            public const String table_name = "table_name";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=View Name^</summary>
            public const String view_name = "view_name";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Package Name^</summary>
            public const String package_name = "package_name";

            ///<summary></summary>
            public const String storage_text = "storage_text";

            ///<summary></summary>
            public const String logical_text = "logical_text";

            ///<summary></summary>
            public const String data_entity = "data_entity";

            ///<summary></summary>
            public const String objid = "objid";

            ///<summary></summary>
            public const String objversion = "objversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Ifnd_design_lu
    {
       #region 属性
        /// <summary>FLAGS=KMIU-^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>

        String lu_name { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(100)^PROMPT=Description^</summary>

        String description { get; set; }


        /// <summary>FLAGS=AMI-L^DATATYPE=STRING(10)^PROMPT=Module^</summary>

        String module { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=Table Name^</summary>

        String table_name { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(40)^PROMPT=View Name^</summary>

        String view_name { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Package Name^</summary>

        String package_name { get; set; }


        /// <summary></summary>

        Byte[] storage_text { get; set; }


        /// <summary></summary>

        Byte[] logical_text { get; set; }


        /// <summary></summary>

        Byte[] data_entity { get; set; }


        /// <summary></summary>

        String objid { get; set; }


        /// <summary></summary>

        String objversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}